<?php

class Global_setting_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }
	
	var $table_name = 'global_setting';
	var $primary_key = 'key';
	var $display_field = '';
	var $_foreign_keys = array(
		// 'MaLop' => array('Lop_model', 'MaLop'),
	);
	
	function _get($key, $default) {
	
		$row = $this->_find_row($key);
		if (empty($row)) {
			$this->_insert(array('key' => $key, 'value' => $value));
		} else {
			$default = $row['value'];
		}
		
		return $default;
	}
}